const mongoConnected = require("../lib/mongoose_connect");
const mongoModels = require("../lib/mongoose_schemas");
const fs = require("fs-extra");
const path = require("path");
const lodash = require("lodash");

mongoConnected.then(async $ => {
  
  let luodian_qianwu = (await mongoModels.TB21_luodian.find({
    "map_name": "Savage_Main",
    "ranking": {
      "$lte": 5
    }
  }, "luodian")).map(e => e.luodian);
  let luodian_kaohou = (await mongoModels.TB21_luodian.find({
    "map_name": "Savage_Main",
    "ranking": {
      "$gt": 5
    },
    "luodian": {
      "$ne": null
    }
  }, "luodian")).map(e => e.luodian);
  await fs.writeFile(path.join(__dirname, "../test", "21-0117luodian-qianwu-and-kaohou.json"), JSON.stringify({
    qianwu: luodian_qianwu,
    kaohou: luodian_kaohou
  }))
  debugger

})

